<template>
    <el-form :model="deliverDetail" class="demo-form-inline" label-width="120px">
    <el-form-item label="任务名称">
      <span>{{ deliverDetail.name }}</span>
    </el-form-item>
    <el-form-item label="产品名称">
        <span>{{ deliverDetail.productId }}</span>
    </el-form-item>
    <el-form-item label="标题">
      <span>{{ deliverDetail.title }}</span>
    </el-form-item>

    <el-form-item label="邮件正文">
      <span>{{ deliverDetail.content }}</span>
    </el-form-item>

    <el-form-item label="发送邮箱">
      <span>{{ deliverDetail.sendMails }}</span>
    </el-form-item>

    
    <el-form-item label="星期">
      <el-checkbox-group :modelValue="deliverDetail.weekdays?deliverDetail.weekdays.split(',').map((e:any)=> parseInt(e)):[]">
        <el-checkbox :label="1" name="monday">周一</el-checkbox>
        <el-checkbox :label="2" name="tuesday">周二</el-checkbox>
        <el-checkbox :label="3" name="wednesday">周三</el-checkbox>
        <el-checkbox :label="4" name="thursday">周四</el-checkbox>
        <el-checkbox :label="5" name="friday">周五</el-checkbox>
        <el-checkbox :label="6" name="saturday">周六</el-checkbox>
        <el-checkbox :label="7" name="sunday">周日</el-checkbox>
      </el-checkbox-group>
    </el-form-item>

    <el-form-item label="时间">
      <div class="example-basic">
        <span>{{ deliverDetail.timeBegin }}</span>
        <span>~</span>
        <span>{{ deliverDetail.timeEnd }}</span>
      </div>
    </el-form-item>

    <el-form-item label="间隔">
      <span>{{ deliverDetail.spaceBegin }}</span>
      <span>~</span>
      <span>{{ deliverDetail.spaceEnd  }}</span>
      <span>分钟</span>
    </el-form-item>

    <el-table :data="deliverDetail.companyList" style="width: 85%" :cell-style="{ textAlign: 'center' }"
      :header-cell-style="{ 'text-align': 'center', background: '#fafafa', color: '#606266' }">
      <el-table-column prop="no" label="客户编号" width="200" />
      <el-table-column prop="labels" label="客户标签" />
      <el-table-column prop="name" label="客户名称" />
      <el-table-column prop="updTime" label="更新时间" width="200" />
    </el-table>
    <el-form-item label="备注" >
      <span>{{  deliverDetail.remark  }}</span>
    </el-form-item>
  </el-form>
</template>

<script setup lang="ts">
defineProps({
    deliverDetail: {
    type: Object,
    required: true
  },
})
</script>

<style scoped>

</style>